﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebTest2.aspx.cs" Inherits="TestWeb25.WebTest2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Test 2</title>
    <style>
        div {padding-bottom:20px;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <script>

        webRestExplorer.registerNS("TestWeb25.Components.UserGui.Providers");

        TestWeb25.Components.UserGui.Providers.Calculator = function Calculator() { }
        TestWeb25.Components.UserGui.Providers.Calculator.version = '1.0.0.0';
        TestWeb25.Components.UserGui.Providers.Calculator.Add = function Add(value1, value2) {
            var callbackMethod = (typeof (CalculatorAddCallback) != 'function') ? webRestExplorer.defaultCallback : CalculatorAddCallback;
            webRestExplorer.getDataFromServer("Calculator.rest?Add&value1=" + value1 + "&value2=" + value2 + "", callbackMethod);
        }

        function CalculatorAddCallback(data) {
            alert(data);
        }
    </script>
    <div>
        <a title="Test" href="javascript:TestWeb25.Components.UserGui.Providers.Calculator.Add(57,35);">Caculate 57+35</a>
    </div>
    </form>
</body>
</html>
